Fixes #24872: Rework api authorization models#5669
Conversation
|
Commit modified |
16e81d3 to
7703cc9
Compare
|
Commit modified |
7703cc9 to
56e1117
Compare
fanf
left a comment
There was a problem hiding this comment.
OK, seems great. I think it needs at least a third pair of eyes to match the API dispatching - cc @clarkenciel perhaps?
clarktsiory
left a comment
There was a problem hiding this comment.
I double-checked the authz in the endpoints, I found a few that could be changed/are not consistent
| val (action, path) = DELETE / "campaigns" / "events" / "{id}" | ||
| val dataContainer: Option[String] = None | ||
| val dataContainer: Option[String] = None | ||
| val authz: List[AuthorizationType] = AuthorizationType.Configuration.Read :: Nil |
There was a problem hiding this comment.
DeleteCampaignEvent here should require Write
| case object ReloadGroup extends GroupApi with GeneralApi with OneParam with StartsAtVersion2 with SortIndex { | ||
| val z: Int = implicitly[Line].value | ||
| val description = "Update given dynamic group node list" | ||
| val (action, path) = GET / "groups" / "{id}" / "reload" | ||
| val authz: List[AuthorizationType] = AuthorizationType.Group.Read :: Nil | ||
| } |
There was a problem hiding this comment.
It could change the list of nodes in the group, so is it safe with Read instead of Write + Edit ?
| case object CheckTechnique extends TechniqueApiPub with ZeroParam with StartsAtVersion16 with SortIndex { | ||
| val z: Int = implicitly[Line].value | ||
| val description = "Check if a techniques is valid yaml, with rudderc compilation, with various output (json ? yaml ?)" | ||
| val (action, path) = POST / "techniques" / "check" | ||
| val authz: List[AuthorizationType] = AuthorizationType.Technique.Write :: AuthorizationType.Technique.Edit :: Nil | ||
| } |
There was a problem hiding this comment.
I'm not sure if it's just a check (in which case maybe it should be Read), or it does something else behind...
I saw it being used in Elm technique editor, shouldn't we allow them to just check the yaml ?
56e1117 to
211b27e
Compare
|
Edit: ported it to Rudder 8.3 |
|
PR updated with a new commit |
clarktsiory
left a comment
There was a problem hiding this comment.
LGTM, it seems to be targeting master instead of branches/rudder/8.3, once retargeted it can be merged
7f36d1e to
cc06982
Compare
|
This PR is not mergeable to upper versions. |
|
OK, squash merging this PR |
cc06982 to
ab5cc55
Compare
https://issues.rudder.io/issues/24872
Main changes are:
Administration.Write. The compilation error force dev to at least think about the perms a bit,Administration.Writeso that we are going toward suppressiongAdministration.Edit